<!-- build time:Tue Dec 17 2019 19:26:49 GMT+0800 (GMT+08:00) --><!doctype html><html class="theme-next mist" lang="zh-Hans"><head><meta name="generator" content="Hexo 3.8.0"><meta name="google-site-verification" content="7Tau9WyVgxnsEY9oYedu9g0U6_8akOX3wiKbaYcrg9A"><meta name="baidu-site-verification" content="EVwLiaxdxX"><link href="/css/xps13.css" rel="stylesheet" type="text/css"><link href="/css/message.css" rel="stylesheet" type="text/css"><script type="text/javascript" src="/js/jquery-1.11.3.min.js"></script><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css"><link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css"><meta name="keywords" content="servlet&jsp,"><link rel="alternate" href="/atom.xml" title="MrBird" type="application/atom+xml"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1"><meta name="description" content="JSTL（JSP Standard Tag Library）下载地址：https://jstl.java.net/。JSTL包含：1.JSTL API2.JSTL ImplementationJSP页面中使用JSTL，使用taglib指令引入：1&amp;lt;%@ taglib rui=&quot;uri&quot; prefix=&quot;prefix&quot;%&amp;gt;"><meta name="keywords" content="servlet&amp;jsp"><meta property="og:type" content="article"><meta property="og:title" content="JSP Standard Tag Library"><meta property="og:url" content="http://mrbird.cc/JSP-Standard-Tag-Library.html"><meta property="og:site_name" content="MrBird"><meta property="og:description" content="JSTL（JSP Standard Tag Library）下载地址：https://jstl.java.net/。JSTL包含：1.JSTL API2.JSTL ImplementationJSP页面中使用JSTL，使用taglib指令引入：1&amp;lt;%@ taglib rui=&quot;uri&quot; prefix=&quot;prefix&quot;%&amp;gt;"><meta property="og:locale" content="zh-Hans"><meta property="og:updated_time" content="2019-10-28T12:14:46.236Z"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="JSP Standard Tag Library"><meta name="twitter:description" content="JSTL（JSP Standard Tag Library）下载地址：https://jstl.java.net/。JSTL包含：1.JSTL API2.JSTL ImplementationJSP页面中使用JSTL，使用taglib指令引入：1&amp;lt;%@ taglib rui=&quot;uri&quot; prefix=&quot;prefix&quot;%&amp;gt;"><script type="text/javascript" id="hexo.configurations">var NexT=window.NexT||{},CONFIG={root:"/",scheme:"Mist",sidebar:{position:"left",display:"always",offset:12,offset_float:0,b2t:!1,scrollpercent:!1},fancybox:!1,motion:!1}</script><title>JSP Standard Tag Library | MrBird</title></head><body ondragstart="return!1" class="animsition" lang="zh-Hans" style="overflow-x:hidden;padding-right:280px"><script type="text/javascript" src="/js/mo.min.js"></script><style>@media (min-width:768px) and (max-width:991px){body .header-innerr{width:700px!important}}.header-innerr{margin:0 auto;padding:100px 0 70px;width:880px}@media (min-width:1600px){.container .header-innerr{width:1200px}}.header-innerr{position:relative}.header-innerr{padding:20px 0 0}.header-innerr:after,.header-innerr:before{content:" ";display:table}.header-innerr:after{clear:both}@media (max-width:767px){.header-innerr{width:auto;padding:10px;margin-bottom:-20px}}</style><div class="container sidebar-position-left page-post-detail"><div class="headband"></div><header id="header" class="header"><div class="header-inner"><div class="site-brand-wrapper"><div class="site-meta"><link href="https://fonts.font.im/css?family=Merienda" rel="stylesheet"><div class="custom-logo-site-title"><a href="/" class="brand" rel="start"><span class="logo-line-before"><i></i></span> <span class="site-title" style="font-family:Merienda;font-size:1.3rem">MrBird</span> <span class="logo-line-after"><i></i></span></a></div><p class="site-subtitle"></p></div><div class="site-nav-toggle"><button><span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span></button></div></div><nav class="site-nav"><ul id="menu" class="menu"><li class="menu-item menu-item-home"><a href="/" rel="section">HOME</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section">ARCHIVES</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section">TAGS</a></li><li class="menu-item menu-item-friends"><a href="/friends/" rel="section">FRIENDS</a></li><div class="sidebar-toggle" style="display:none"><div class="sidebar-toggle-line-wrap"><span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span></div></div></ul><div class="site-search"><div class="popup search-popup local-search-popup"><div class="local-search-header clearfix"><span class="search-icon"><i class="fa fa-search"></i> </span><span class="popup-btn-close"><i class="fa fa-times-circle"></i></span><div class="local-search-input-wrapper"><input autocomplete="off" placeholder="Search" spellcheck="false" type="text" id="local-search-input"></div></div><div id="local-search-result"></div></div></div></nav></div><div class="header-innerr"><div class="note info" style="margin:0;letter-spacing:.15px">🐤手把手教你搭建<strong>Spring Cloud微服务权限系统</strong>（从零到部署）：<a style="color:#40dab2;font-weight:600" href="https://www.kancloud.cn/mrbird/spring-cloud" target="_blank">https://www.kancloud.cn/mrbird/spring-cloud</a></div></div></header><main id="main" class="main"><div class="main-inner"><div class="content-wrap"><div id="content" class="content"><div id="posts" class="posts-expand"><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://mrbird.cc/JSP-Standard-Tag-Library.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="MrBird"><meta itemprop="description" content=""><meta itemprop="image" content="/images/blogImage.jpg"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="MrBird"></span><header class="post-header"><h1 class="post-title" itemprop="name headline">JSP Standard Tag Library</h1><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i> </span><span class="post-meta-item-text">Posted on</span> <time title="创建于" itemprop="dateCreated datePublished" datetime="2016-11-07T09:19:15+08:00">2016-11-07 </time></span><span></span> <span class="post-meta-divider">|</span> <span class="page-pv"><i class="fa fa-laptop"></i>&nbsp;&nbsp;Visit count <span class="busuanzi-value" id="busuanzi_value_page_pv"></span></span></div></header><div class="post-body" itemprop="articleBody"><p>JSTL（JSP Standard Tag Library）下载地址：<a href="https://jstl.java.net/" target="_blank" rel="noopener">https://jstl.java.net/</a>。</p><p>JSTL包含：</p><p>1.JSTL API</p><p>2.JSTL Implementation</p><p>JSP页面中使用JSTL，使用taglib指令引入：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">%@</span> <span class="attr">taglib</span> <span class="attr">rui</span>=<span class="string">"uri"</span> <span class="attr">prefix</span>=<span class="string">"prefix"</span>%&gt;</span></span><br></pre></td></tr></table></figure><p></p><a id="more"></a><h2 id="通用动作指令"><a href="#通用动作指令" class="headerlink" title="通用动作指令"></a>通用动作指令</h2><p>引入：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">%@</span> <span class="attr">taglib</span> <span class="attr">prefix</span>=<span class="string">"c"</span> <span class="attr">uri</span>=<span class="string">"http://java.sun.com/jsp/jstl/core"</span> %&gt;</span></span><br></pre></td></tr></table></figure><p></p><h3 id="out标签"><a href="#out标签" class="headerlink" title="out标签"></a>out标签</h3><p>标记<code>&lt;c:out&gt;</code>具有以下属性：</p><table><tr><td>属性</td><td>描述</td></tr><tr><td>value*+ &nbsp;</td><td>要运算的表达式</td></tr><tr><td>default</td><td>默认值</td></tr><tr><td>escapeXml</td><td>True，如果标签转义特殊XML字符</td></tr></table><p><code>*</code>表示属性是必需的，<code>+</code>号表示可以为表达式。</p><p>默认情况下，<code>excapeXml</code>属性为true，意味着会将&lt;，&gt;，’，”和&amp;转换为&lt;，&gt;，&#039;和&amp;。</p><h3 id="set标签"><a href="#set标签" class="headerlink" title="set标签"></a>set标签</h3><p><code>&lt;c:set&gt;</code>标记具有以下属性：</p><table><tr><th>属性<br></th><th>描述</th></tr><tr><td>value+</td><td>要创建的字符串，或要引用的限域对象，或新的属性值</td></tr><tr><td>target+</td><td>其属性应该被修改的限域对象目标</td></tr><tr><td>property+</td><td>要修改的属性名称</td></tr><tr><td>var</td><td>限域变量</td></tr><tr><td>scope</td><td>范围，默认为page</td></tr></table><p>如，创建一个page范围的foo变量，并赋值：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"foo"</span> <span class="attr">value</span>=<span class="string">"The wisest fool"</span>/&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>创建一个限域变量job，值为request范围的对象position，限域变量的范围为page：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"job"</span> <span class="attr">value</span>=<span class="string">"$&#123;requestScope.position&#125;"</span> <span class="attr">socpe</span>=<span class="string">"page"</span>/&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>设置address对象的city属性为fuzhou：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">target</span>=<span class="string">"$&#123;address&#125;"</span> <span class="attr">property</span>=<span class="string">"city"</span> <span class="attr">value</span>=<span class="string">"fuzhzou"</span>/&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>也可以这样写：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">target</span>=<span class="string">"$&#123;address&#125;"</span> <span class="attr">property</span>=<span class="string">"city"</span>&gt;</span></span><br><span class="line">    fuzhou</span><br><span class="line"><span class="tag">&lt;/<span class="name">c:set</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><h3 id="remove标签"><a href="#remove标签" class="headerlink" title="remove标签"></a>remove标签</h3><p><code>&lt;c:remove&gt;</code>标签具有以下属性：</p><table><tr><th>属性</th><th>描述</th><th>默认值</th></tr><tr><td>var</td><td>要删除的变量名</td><td>None</td></tr><tr><td>scope</td><td>删除变量的作用域</td><td>所有作用域</td></tr></table><p>如删除作用域为page的job限域变量：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:remove</span> <span class="attr">var</span>=<span class="string">"job"</span> <span class="attr">scope</span>=<span class="string">"page"</span>/&gt;</span></span><br></pre></td></tr></table></figure><p></p><h2 id="条件式动作指令"><a href="#条件式动作指令" class="headerlink" title="条件式动作指令"></a>条件式动作指令</h2><p>引入：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">%@</span> <span class="attr">taglib</span> <span class="attr">prefix</span>=<span class="string">"c"</span> <span class="attr">uri</span>=<span class="string">"http://java.sun.com/jsp/jstl/core"</span> %&gt;</span></span><br></pre></td></tr></table></figure><p></p><h3 id="if标签"><a href="#if标签" class="headerlink" title="if标签"></a>if标签</h3><p><code>&lt;c:if&gt;</code>标签具有以下属性：</p><table><tr><th>属性</th><th>描述</th><th>默认</th></tr><tr><td>test*+</td><td>条件计算</td><td>None</td></tr><tr><td>var</td><td>变量名称来存储条件的结果，Boolean类型</td><td>None</td></tr><tr><td>scope</td><td>var变量的作用域</td><td>page</td></tr></table><p>如：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"salary"</span> <span class="attr">scope</span>=<span class="string">"session"</span> <span class="attr">value</span>=<span class="string">"$&#123;2000*2&#125;"</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:if</span> <span class="attr">test</span>=<span class="string">"$&#123;salary &gt; 2000&#125;"</span>&gt;</span></span><br><span class="line">    My salary is: <span class="tag">&lt;<span class="name">c:out</span> <span class="attr">value</span>=<span class="string">"$&#123;salary&#125;"</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">c:if</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>模拟if…else：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:if</span> <span class="attr">test</span>=<span class="string">"$&#123;param.user=='mrbird' &amp;&amp; password=='mrbird'&#125;"</span>&gt;</span></span><br><span class="line">    mrbird logged in successfully.</span><br><span class="line"><span class="tag">&lt;/<span class="name">c:if</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:if</span> <span class="attr">test</span>=<span class="string">"$&#123;!(param.user=='mrbird' &amp;&amp; password=='mrbird')&#125;"</span>&gt;</span></span><br><span class="line">    userName or password is wrong</span><br><span class="line"><span class="tag">&lt;/<span class="name">c:if</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><h3 id="choose-when和otherwise"><a href="#choose-when和otherwise" class="headerlink" title="choose,when和otherwise"></a>choose,when和otherwise</h3><p>该标签类似于Java中的switch和case关键字类似，使用方法如下：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:choose</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">c:when</span> <span class="attr">test</span>=<span class="string">"$&#123;param.user=="</span><span class="attr">mrbird</span>"&#125;"&gt;</span></span><br><span class="line">        hi,mrbird.</span><br><span class="line">    <span class="tag">&lt;/<span class="name">c:when</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">c:when</span> <span class="attr">test</span>=<span class="string">"$&#123;param.user=="</span><span class="attr">jint</span>"&#125;"&gt;</span></span><br><span class="line">        hi,jint.</span><br><span class="line">    <span class="tag">&lt;/<span class="name">c:when</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">c:otherwise</span>&gt;</span></span><br><span class="line">        hi,someone else.</span><br><span class="line">    <span class="tag">&lt;/<span class="name">c:otherwise</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">c:choose</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><h2 id="iterator动作指令"><a href="#iterator动作指令" class="headerlink" title="iterator动作指令"></a>iterator动作指令</h2><h3 id="forEach标签"><a href="#forEach标签" class="headerlink" title="forEach标签"></a>forEach标签</h3><p><code>&lt;c:forEach&gt;</code>标记具有以下属性：</p><table><tr><th>属性</th><th>描述</th><th>默认</th></tr><tr><td>items+</td><td>要迭代的对象集合</td><td>None</td></tr><tr><td>begin+</td><td>开始索引</td><td>0</td></tr><tr><td>end+</td><td>结束索引</td><td>Last element</td></tr><tr><td>step+</td><td>迭代步长</td><td>1</td></tr><tr><td>var</td><td>当前迭代内容的限域变量名</td><td>None</td></tr><tr><td>varStatus</td><td>保存迭代状态的限域变量名</td><td>None</td></tr></table><p>其中，<code>varStatus</code>包含一些属性：</p><p>1.current当前这次迭代的（集合中的）项</p><p>2.index当前这次迭代从 0 开始的迭代索引</p><p>3.count当前这次迭代从 1 开始的迭代计数</p><p>4.first用来表明当前这轮迭代是否为第一次迭代的标志</p><p>5.last用来表明当前这轮迭代是否为最后一次迭代的标志</p><p>如循环输出books集合，并控制单双行表格样式：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">tr</span> <span class="attr">style</span>=<span class="string">"background:#ababff"</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">td</span>&gt;</span>ISBN<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">td</span>&gt;</span>Title<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">tr</span>&gt;</span>    </span><br><span class="line">    <span class="tag">&lt;<span class="name">c:forEach</span> <span class="attr">item</span>=<span class="string">"$&#123;requestScope.books&#125;"</span> <span class="attr">var</span>=<span class="string">"book"</span> <span class="attr">vatStatus</span>=<span class="string">"status"</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">c:if</span> <span class="attr">test</span>=<span class="string">"$&#123;status.count%2 == 0&#125;"</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">tr</span> <span class="attr">style</span>=<span class="string">"background:#eeeeff"</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">c:if</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">c:if</span> <span class="attr">test</span>=<span class="string">"$&#123;status.count%2 != 0&#125;"</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">tr</span> <span class="attr">style</span>=<span class="string">"background:#dedeff"</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">c:if</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">td</span>&gt;</span>$&#123;book.isbn&#125;<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">td</span>&gt;</span>$&#123;book.title&#125;<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">tr</span>&gt;</span>    </span><br><span class="line">    <span class="tag">&lt;/<span class="name">c:forEach</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>简单的<code>forEach</code>标签示例：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:forEach</span> <span class="attr">var</span>=<span class="string">"x"</span> <span class="attr">begin</span>=<span class="string">"1"</span> <span class="attr">end</span>=<span class="string">"5"</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">c:out</span> <span class="attr">value</span>=<span class="string">"$&#123;x&#125;"</span>/&gt;</span>,</span><br><span class="line"><span class="tag">&lt;/<span class="name">c:forEach</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>页面输出1，2，3，4，5。</p><h3 id="forTokens标签"><a href="#forTokens标签" class="headerlink" title="forTokens标签"></a>forTokens标签</h3><p><code>forTokens</code>标签使用的比较少，常用的例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:forTokens</span> <span class="attr">items</span>=<span class="string">"Zara,nuha,roshy"</span> <span class="attr">delims</span>=<span class="string">","</span> <span class="attr">var</span>=<span class="string">"name"</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">c:out</span> <span class="attr">value</span>=<span class="string">"$&#123;name&#125;"</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">c:forTokens</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>这将产生以下输出结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Zara</span><br><span class="line">nuha</span><br><span class="line">roshy</span><br></pre></td></tr></table></figure><p></p><h2 id="格式化动作指令"><a href="#格式化动作指令" class="headerlink" title="格式化动作指令"></a>格式化动作指令</h2><p>引入：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">%@</span> <span class="attr">taglib</span> <span class="attr">prefix</span>=<span class="string">"fmt"</span> <span class="attr">uri</span>=<span class="string">"http://java.sun.com/jsp/jstl/fmt"</span> %&gt;</span></span><br></pre></td></tr></table></figure><p></p><h3 id="formatNumber标签"><a href="#formatNumber标签" class="headerlink" title="formatNumber标签"></a>formatNumber标签</h3><p><code>&lt;fmt:formatNumber&gt;</code>标签用于格式化数字，百分比和货币。<code>&lt;fmt:formatNumber&gt;</code>标签有如下属性：</p><table><tr><th>属性</th><th>描述</th><th>默认值</th></tr><tr><td>value*+</td><td>要显示的数字</td><td>无</td></tr><tr><td>type+</td><td>NUMBER，CURRENCY，或 PERCENT类型</td><td>Number</td></tr><tr><td>pattern+</td><td>指定一个自定义的格式化模式用于输出</td><td>无</td></tr><tr><td>currencyCode+</td><td>货币码（当type=”currency”时）</td><td>取决于默认区域</td></tr><tr><td>currencySymbol+</td><td>货币符号 (当 type=”currency”时)</td><td>取决于默认区域</td></tr><tr><td>groupingUsed+</td><td>是否对数字分组 (TRUE 或 FALSE)</td><td>true</td></tr><tr><td>maxIntegerDigits+</td><td>整型数最大的位数</td><td>无</td></tr><tr><td>minIntegerDigits+</td><td>整型数最小的位数</td><td>无</td></tr><tr><td>maxFractionDigits+</td><td>小数点后最大的位数</td><td>无</td></tr><tr><td>minFractionDigits+</td><td>小数点后最小的位数</td><td>无</td></tr><tr><td>var</td><td>存储格式化数字的变量</td><td>Print to page</td></tr><tr><td>scope</td><td>var属性的作用域</td><td>page</td></tr></table><p><code>pattern</code>属性包含的字符：</p><table><tr><th>符号</th><th>描述</th></tr><tr><td>0</td><td>代表一位数字</td></tr><tr><td>E</td><td>使用指数格式</td></tr><tr><td>#</td><td>代表一位数字，若没有则显示0</td></tr><tr><td>.</td><td>小数点</td></tr><tr><td>,</td><td>数字分组分隔符</td></tr><tr><td>;</td><td>分隔格式</td></tr><tr><td>-</td><td>使用默认负数前缀</td></tr><tr><td>%</td><td>百分数</td></tr><tr><td>?</td><td>千分数</td></tr><tr><td>¤</td><td>货币符号，使用实际的货币符号代替</td></tr><tr><td>X</td><td>指定可以作为前缀或后缀的字符</td></tr><tr><td>‘</td><td>在前缀或后缀中引用特殊字符</td></tr></table><p>例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"balance"</span> <span class="attr">value</span>=<span class="string">"120000.2309"</span> /&gt;</span></span><br><span class="line">格式化数字 (1): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">type</span>=<span class="string">"currency"</span>/&gt;</span></span><br><span class="line">格式化数字 (2): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"number"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">maxIntegerDigits</span>=<span class="string">"3"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">格式化数字 (3): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"number"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">maxFractionDigits</span>=<span class="string">"3"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">格式化数字 (4): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"number"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">groupingUsed</span>=<span class="string">"false"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">格式化数字 (5): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"percent"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">maxIntegerDigits</span>=<span class="string">"3"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">格式化数字 (6): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"percent"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">minFractionDigits</span>=<span class="string">"10"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">格式化数字 (7): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"percent"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">maxIntegerDigits</span>=<span class="string">"3"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">格式化数字 (8): <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">type</span>=<span class="string">"number"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">pattern</span>=<span class="string">"###.###E0"</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> /&gt;</span></span><br><span class="line">美元 :</span><br><span class="line">    <span class="tag">&lt;<span class="name">fmt:setLocale</span> <span class="attr">value</span>=<span class="string">"en_US"</span>/&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">fmt:formatNumber</span> <span class="attr">value</span>=<span class="string">"$&#123;balance&#125;"</span> <span class="attr">type</span>=<span class="string">"currency"</span>/&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">数字格式化:</span><br><span class="line">格式化数字 (1): ￥120,000.23</span><br><span class="line">格式化数字 (2): 000.231</span><br><span class="line">格式化数字 (3): 120,000.231</span><br><span class="line">格式化数字 (4): 120000.231</span><br><span class="line">格式化数字 (5): 023%</span><br><span class="line">格式化数字 (6): 12,000,023.0900000000%</span><br><span class="line">格式化数字 (7): 023%</span><br><span class="line">格式化数字 (8): 120E3</span><br><span class="line">美元 : $120,000.23</span><br></pre></td></tr></table></figure><p></p><h3 id="formatDate标签"><a href="#formatDate标签" class="headerlink" title="formatDate标签"></a>formatDate标签</h3><p><code>&lt;fmt:formatDate&gt;</code>标签用于使用不同的方式格式化日期。</p><p><code>&lt;fmt:formatDate&gt;</code>标签有如下属性：</p><table><tr><th>属性</th><th>描述</th><th>是否必要</th><th>默认值</th></tr><tr><td>value</td><td>要显示的日期</td><td>是</td><td>无</td></tr><tr><td>type</td><td>DATE, TIME, 或 BOTH</td><td>否</td><td>date</td></tr><tr><td>dateStyle</td><td>FULL, LONG, MEDIUM, SHORT, 或 DEFAULT</td><td>否</td><td>default</td></tr><tr><td>timeStyle</td><td>FULL, LONG, MEDIUM, SHORT, 或 DEFAULT</td><td>否</td><td>default</td></tr><tr><td>pattern</td><td>自定义格式模式</td><td>否</td><td>无</td></tr><tr><td>timeZone</td><td>显示日期的时区</td><td>否</td><td>默认时区</td></tr><tr><td>var</td><td>存储格式化日期的变量名</td><td>否</td><td>显示在页面</td></tr><tr><td>scope</td><td>存储格式化日志变量的范围</td><td>否</td><td>页面</td></tr></table><p><code>&lt;fmt:formatDate&gt;</code> 标签格式模式：</p><table><tr><th>代码</th><th>描述</th><th>实例</th></tr><tr><td>G</td><td>时代标志</td><td>AD</td></tr><tr><td>y</td><td>不包含纪元的年份。如果不包含纪元的年份小于 10， 则显示不具有前导零的年份。</td><td>2002</td></tr><tr><td>M</td><td>月份数字。一位数的月份没有前导零。</td><td>April &amp; 04</td></tr><tr><td>d</td><td>月中的某一天。一位数的日期没有前导零。</td><td>20</td></tr><tr><td>h</td><td>12 小时制的小时。一位数的小时数没有前导零。</td><td>12</td></tr><tr><td>H</td><td>24 小时制的小时。一位数的小时数没有前导零。</td><td>0</td></tr><tr><td>m</td><td>分钟。一位数的分钟数没有前导零。</td><td>45</td></tr><tr><td>s</td><td>秒。一位数的秒数没有前导零。</td><td>52</td></tr><tr><td>S</td><td>毫秒</td><td>970</td></tr><tr><td>E</td><td>周几</td><td>Tuesday</td></tr><tr><td>D</td><td>一年中的第几天</td><td>180</td></tr><tr><td>F</td><td>一个月中的第几个周几</td><td>2 (一个月中的第二个星期三)</td></tr><tr><td>w</td><td>一年中的第几周r</td><td>27</td></tr><tr><td>W</td><td>一个月中的第几周</td><td>2</td></tr><tr><td>a</td><td>a.m./p.m. 指示符</td><td>PM</td></tr><tr><td>k</td><td>小时(12 小时制的小时)</td><td>24</td></tr><tr><td>K</td><td>小时(24 小时制的小时)</td><td>0</td></tr><tr><td>z</td><td>时区</td><td>中部标准时间</td></tr><tr><td>‘</td><td>&nbsp;</td><td>转义文本</td></tr><tr><td>‘’</td><td>&nbsp;</td><td>单引号</td></tr></table><p>例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"now"</span> <span class="attr">value</span>=<span class="string">"&lt;%=new java.util.Date()%&gt;"</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (1): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">type</span>=<span class="string">"time"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (2): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">type</span>=<span class="string">"date"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (3): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">type</span>=<span class="string">"both"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (4): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">type</span>=<span class="string">"both"</span> <span class="attr">dateStyle</span>=<span class="string">"short"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">timeStyle</span>=<span class="string">"short"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (5): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">type</span>=<span class="string">"both"</span> <span class="attr">dateStyle</span>=<span class="string">"medium"</span> </span></span><br><span class="line"><span class="tag">                    <span class="attr">timeStyle</span>=<span class="string">"medium"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (6): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">type</span>=<span class="string">"both"</span> <span class="attr">dateStyle</span>=<span class="string">"long"</span></span></span><br><span class="line"><span class="tag">                    <span class="attr">timeStyle</span>=<span class="string">"long"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>日期格式化 (7): <span class="tag">&lt;<span class="name">fmt:formatDate</span> <span class="attr">pattern</span>=<span class="string">"yyyy-MM-dd"</span> <span class="attr">value</span>=<span class="string">"$&#123;now&#125;"</span> /&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">日期格式化:</span><br><span class="line">日期格式化 (1): 11:19:43</span><br><span class="line">日期格式化 (2): 2016-6-26</span><br><span class="line">日期格式化 (3): 2016-6-26 11:19:43</span><br><span class="line">日期格式化 (4): 16-6-26 上午11:19</span><br><span class="line">日期格式化 (5): 2016-6-26 11:19:43</span><br><span class="line">日期格式化 (6): 2016年6月26日 上午11时19分43秒</span><br><span class="line">日期格式化 (7): 2016-06-26</span><br></pre></td></tr></table></figure><p></p><p>剩下的fmt标签较少使用，懒得记录。</p><h2 id="函数"><a href="#函数" class="headerlink" title="函数"></a>函数</h2><p>引入：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">%@</span> <span class="attr">taglib</span> <span class="attr">prefix</span>=<span class="string">"fn"</span> <span class="attr">uri</span>=<span class="string">"http://java.sun.com/jsp/jstl/functions"</span> %&gt;</span></span><br></pre></td></tr></table></figure><p></p><h3 id="contains函数"><a href="#contains函数" class="headerlink" title="contains函数"></a>contains函数</h3><p><code>fn:contains()</code>函数的语法如下：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:if</span> <span class="attr">test</span>=<span class="string">"$&#123;fn:contains(&lt;原始字符串&gt;, &lt;要查找的子字符串&gt;)&#125;"</span>&gt;</span></span><br><span class="line">    ...</span><br><span class="line"><span class="tag">&lt;/<span class="name">c:if</span>&gt;</span>﻿​</span><br></pre></td></tr></table></figure><p></p><p>如，下面的EL表达式都返回true：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"myString"</span> <span class="attr">value</span>=<span class="string">"Hello World"</span>/&gt;</span></span><br><span class="line">$&#123;fn:contains(myString,"Hello")&#125;</span><br><span class="line">$&#123;fn:contains("Stella Cadente","Cadente")&#125;</span><br></pre></td></tr></table></figure><p></p><h3 id="containsIgnoreCase函数"><a href="#containsIgnoreCase函数" class="headerlink" title="containsIgnoreCase函数"></a>containsIgnoreCase函数</h3><p>和<code>contains</code>类似，不区分大小写。</p><h3 id="endsWith函数"><a href="#endsWith函数" class="headerlink" title="endsWith函数"></a>endsWith函数</h3><p>判断以什么为结尾。</p><h3 id="startsWith函数"><a href="#startsWith函数" class="headerlink" title="startsWith函数"></a>startsWith函数</h3><h3 id="escapeXml函数"><a href="#escapeXml函数" class="headerlink" title="escapeXml函数"></a>escapeXml函数</h3><p>如：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$&#123;fn:escapeXml("Use <span class="tag">&lt;<span class="name">br</span>&gt;</span> to change lines")&#125;</span><br></pre></td></tr></table></figure><p></p><p>显示为：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Use <span class="tag">&lt;<span class="name">br</span>&gt;</span> to change lines</span><br></pre></td></tr></table></figure><p></p><h3 id="indexOf函数"><a href="#indexOf函数" class="headerlink" title="indexOf函数"></a>indexOf函数</h3><p><code>fn:indexOf()</code>函数返回一个字符串中指定子串的位置。</p><p><code>fn:indexOf()</code>函数的语法如下：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$&#123;fn:indexOf(<span class="tag">&lt;<span class="name">原始字符串</span>&gt;</span>,<span class="tag">&lt;<span class="name">子字符串</span>&gt;</span>)&#125;</span><br></pre></td></tr></table></figure><p></p><p>例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string1"</span> <span class="attr">value</span>=<span class="string">"This is first String."</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>Index: $&#123;fn:indexOf(string1, "first")&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Index: 8</span><br></pre></td></tr></table></figure><p></p><h3 id="join函数"><a href="#join函数" class="headerlink" title="join函数"></a>join函数</h3><p><code>fn:join()</code>函数将一个数组中的所有元素使用指定的分隔符来连接成一个字符串。</p><h3 id="split函数"><a href="#split函数" class="headerlink" title="split函数"></a>split函数</h3><p><code>fn:split()</code>函数将一个字符串用指定的分隔符分裂为一个子串数组。</p><p>join和split例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string1"</span> <span class="attr">value</span>=<span class="string">"www runoob com"</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string2"</span> <span class="attr">value</span>=<span class="string">"$&#123;fn:split(string1, ' ')&#125;"</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string3"</span> <span class="attr">value</span>=<span class="string">"$&#123;fn:join(string2, '-')&#125;"</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>string3 字符串 : $&#123;string3&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果为：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">字符串为 : www-runoob-com</span><br></pre></td></tr></table></figure><p></p><h3 id="length函数"><a href="#length函数" class="headerlink" title="length函数"></a>length函数</h3><h3 id="replace函数"><a href="#replace函数" class="headerlink" title="replace函数"></a>replace函数</h3><p><code>fn:replace()</code>函数将字符串中所有指定的子串用另外的字符串替换。</p><p><code>fn:replace()</code>函数的语法如下：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$&#123;fn:replace(<span class="tag">&lt;<span class="name">原始字符串</span>&gt;</span>, <span class="tag">&lt;<span class="name">被替换的字符串</span>&gt;</span>, <span class="tag">&lt;<span class="name">要替换的字符串</span>&gt;</span>)&#125;</span><br></pre></td></tr></table></figure><p></p><p>例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string1"</span> <span class="attr">value</span>=<span class="string">"I am from USA"</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string2"</span> <span class="attr">value</span>=<span class="string">"$&#123;fn:replace(string1, 'USA', 'China')&#125;"</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>替换后的字符串 : $&#123;string2&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">替换后的字符串 : I am from China</span><br></pre></td></tr></table></figure><p></p><h3 id="substring函数"><a href="#substring函数" class="headerlink" title="substring函数"></a>substring函数</h3><p><code>fn:substring()</code>函数返回字符串中指定开始和结束索引的子串。</p><p><code>fn:substring()</code>函数的语法如下：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$&#123;fn:substring(<span class="tag">&lt;<span class="name">string</span>&gt;</span>, <span class="tag">&lt;<span class="name">beginIndex</span>&gt;</span>, <span class="tag">&lt;<span class="name">endIndex</span>&gt;</span>)&#125;</span><br></pre></td></tr></table></figure><p></p><p>例子：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string1"</span> <span class="attr">value</span>=<span class="string">"This is first String."</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string2"</span> <span class="attr">value</span>=<span class="string">"$&#123;fn:substring(string1, 5, 15)&#125;"</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>生成的子字符串为 : $&#123;string2&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">生成的子字符串为 : is first S</span><br></pre></td></tr></table></figure><p></p><h3 id="substringBefore函数"><a href="#substringBefore函数" class="headerlink" title="substringBefore函数"></a>substringBefore函数</h3><p><code>fn:substringBefore()</code>函数返回一个字符串中指定子串前面的部分。</p><p>如：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string1"</span> <span class="attr">value</span>=<span class="string">"This is first String."</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">c:set</span> <span class="attr">var</span>=<span class="string">"string2"</span> <span class="attr">value</span>=<span class="string">"$&#123;fn:substringBefore(string1, 'first')&#125;"</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">p</span>&gt;</span>生成的子字符串 : $&#123;string2&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br></pre></td></tr></table></figure><p></p><p>结果：</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">生成的子字符串 : This is</span><br></pre></td></tr></table></figure><p></p><h3 id="substringAfter函数"><a href="#substringAfter函数" class="headerlink" title="substringAfter函数"></a>substringAfter函数</h3><h3 id="toLowerCase函数"><a href="#toLowerCase函数" class="headerlink" title="toLowerCase函数"></a>toLowerCase函数</h3><h3 id="toUpperCase函数"><a href="#toUpperCase函数" class="headerlink" title="toUpperCase函数"></a>toUpperCase函数</h3><h3 id="trim函数"><a href="#trim函数" class="headerlink" title="trim函数"></a>trim函数</h3><h2 id="sql标签"><a href="#sql标签" class="headerlink" title="sql标签"></a>sql标签</h2><p>略。</p><blockquote><p><a href="https://book.douban.com/subject/22994746/" target="_blank" rel="noopener">《Servlet和JSP学习指南》</a>学习笔记</p></blockquote><script>$(".post-body a").not(".thispage").addClass("ignore-href").attr("target","_blank")</script></div><div></div><div><div style="padding:10px 0;margin:20px auto;width:90%;text-align:center;color:#878787"><div>请作者喝瓶肥宅水~</div><button id="rewardButton" style="margin-top:10px" disable="enable" onclick='var e=document.getElementById("QR");"none"===e.style.display?e.style.display="block":e.style.display="none"'><span style="height:46px;width:46px;line-height:46px;border-radius:50%;color:#fe5f55;font-weight:600;background:#ffd5be;border:none;box-shadow:0 4px 8px 0 rgba(255,213,190,.4)">￥</span></button><div id="QR" style="display:none"><div id="wechat" style="display:inline-block"><img id="wechat_qr" src="/img/wechat_pay.png" alt="MrBird WeChat Pay"></div><div id="alipay" style="display:inline-block"><img id="alipay_qr" src="/img/ali_pay.png" alt="MrBird Alipay"></div></div></div><style>#QR img{width:auto;margin:.8em 1em 0 1em}</style></div><div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者：</strong> MrBird</li><li class="post-copyright-link"><strong>本文链接：</strong> <a href="http://mrbird.cc/JSP-Standard-Tag-Library.html" title="JSP Standard Tag Library">http://mrbird.cc/JSP-Standard-Tag-Library.html</a></li><li class="post-copyright-license"><strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明出处！</li></ul></div><footer class="post-footer"><div class="post-tags" style="margin-bottom:1.3rem"><a href="/tags/servlet-jsp/" rel="tag"># servlet&jsp</a></div><div class="post-nav"><div class="post-nav-next post-nav-item"><a href="/Java-Server-Pages.html" rel="next" title="Java Server Pages"><i class="fa fa-chevron-left"></i> Java Server Pages</a></div><span class="post-nav-divider"></span><div class="post-nav-prev post-nav-item"><a href="/定制JSP标签.html" rel="prev" title="定制JSP标签">定制JSP标签 <i class="fa fa-chevron-right"></i></a></div></div></footer></article><hr><div id="container"></div><div class="post-spread"><div id="comment-div"></div><style>.valine .vlist{margin-bottom:3rem}.valine .vwrap .vcontrol .col.col-60{text-align:left}.valine .vlist .vcard .vhead,.valine .vlist .vcard section .vfooter{text-align:left}.valine .vlist .vcard section{padding-bottom:.5rem!important}.vname{color:#42b983!important}.valine .vinfo .col{text-align:left;margin-left:-27rem}div#comment-div{margin-bottom:-8rem}.valine .vlist .vcard .vcontent .code,.valine .vlist .vcard .vcontent code,.valine .vlist .vcard .vcontent pre{background:#fbfbfb}.valine .vlist .vcard .vcontent a{color:#42b983}.valine .vlist .vcard .vimg{border-radius:3px}.valine .vbtn{border-radius:2px;padding:.3rem 1.25rem}.valine .vbtn:active,.valine .vbtn:hover{color:#42b983;border-color:#42b983;background-color:#fff}.valine .vwrap .vheader .vinput:focus{border-bottom-color:#42b983}.valine .vlist .vcard .vcontent.expand:before{background:-webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),to(hsla(0,0%,100%,.2)));background:linear-gradient(180deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.2))}.valine .vlist .vcard .vcontent.expand:after{content:"点击展开";font-size:.4rem;text-align:right;left:-1rem;background:hsla(0,0%,100%,.2)}.valine .vlist .vcard section .vfooter .vat{color:#b3b3b3}.valine .vlist .vcard section .vfooter .vat:hover{color:#42b983}.vcontent img{margin:0}.valine .info{display:none}</style><script type="text/javascript" src="/js/av.min.js"></script><script type="text/javascript" src="/js/Valine.min.js"></script><script type="text/javascript" src="/js/activate-power-mode.js"></script><script>POWERMODE.colorful=!0,POWERMODE.shake=!1,document.body.addEventListener("input",POWERMODE),new Valine({el:"#comment-div",notify:!1,verify:!0,appId:"SMcDFP1bN1jgb9Lo8JmtICHm-gzGzoHsz",appKey:"dH4nrUrt3V5XiJiI6Qyejnbi",placeholder:"",path:window.location.pathname,avatar:"monsterid",guest_info:["nick","mail","link"]});var chicken='<a href="#"><img src="https://image.uisdc.com/wp-content/uploads/2018/06/uisdc-chat-chicken.gif" class="checken"></a>';$("#comment-div").prepend(chicken)</script></div></div><script>var $bqinline=$("img[alt='bq-inline']");$bqinline.css({width:"2.3rem",height:"2.3rem",display:"inline","vertical-align":"text-bottom"})</script></div><div class="comments" id="comments"></div></div><aside id="sidebar" class="sidebar" onselectstart="return!1"><div class="sidebar-inner"><ul class="sidebar-nav motion-element"><li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">Contents</li><li class="sidebar-nav-overview" data-target="site-overview">Site Preview</li></ul><section class="site-overview sidebar-panel"><div class="sidebar-sticky sticky"><div itemscope itemtype="http://schema.org/Person"><div class="author__avatar"><img src="/images/blogImage.jpg" class="author__avatar" alt="MrBird" itemprop="image"></div><div class="author__content"><h3 class="author__name" itemprop="name">MrBird's Blog</h3><p class="author__bio" itemprop="description">A simple blog, code repository, just keep blogging</p></div><div class="author__urls-wrapper"><button class="btn btn--inverse">Follow</button><ul class="author__urls social-icons"><li><a href="http://map.baidu.com/?newmap=1&s=s%26wd%3D%E7%A6%8F%E5%B7%9E%E5%B8%82%26c%3D300&from=alamap&tpl=mapcity" target="_blank" itemprop="url" class="ignore-href"><i class="fa fa-fw fa-map-marker" aria-hidden="true"></i>&nbsp;&nbsp;FuZhou,CN</a></li><li><a href="https://love.mrbird.cc" target="_blank" itemprop="url" class="ignore-href"><i class="fa fa-fw fa-diamond" aria-hidden="true"></i>&nbsp;&nbsp;Love</a></li><li><a href="https://cloud.mrbird.cn" target="_blank" itemprop="url" class="ignore-href"><i class="fa fa-fw fa-chain" aria-hidden="true"></i>&nbsp;&nbsp;FEBS</a></li><li><a href="/atom.xml" target="_blank" itemprop="url" class="ignore-href"><i class="fa fa-fw fa-rss" aria-hidden="true"></i>&nbsp;&nbsp;RSS</a></li><li><a href="https://gitee.com/mrbirdd" target="_blank" itemprop="sameAs" class="ignore-href"><i class="fa fa-fw fa-codepen" aria-hidden="true"></i>&nbsp;&nbsp;Gitee</a></li><li><a href="https://github.com/wuyouzhuguli" target="_blank" itemprop="sameAs" class="ignore-href"><i class="fa fa-fw fa-github-alt" aria-hidden="true"></i>&nbsp;&nbsp;GitHub</a></li><li><a href="javascript:;" class="popup-trigger"><i class="fa fa-fw fa-search" aria-hidden="true"></i>&nbsp;&nbsp;Search</a></li></ul></div></div></div><script>var $urls=$(".author__urls").find("a");$urls.each(function(){var o=$(this);o.mouseenter(function(){o.css({color:"#414547"})}),o.mouseleave(function(){o.css({color:""})})})</script></section><section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active"><div class="post-toc"><div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#通用动作指令"><span class="nav-number">1.</span> <span class="nav-text">通用动作指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#out标签"><span class="nav-number">1.1.</span> <span class="nav-text">out标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#set标签"><span class="nav-number">1.2.</span> <span class="nav-text">set标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#remove标签"><span class="nav-number">1.3.</span> <span class="nav-text">remove标签</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#条件式动作指令"><span class="nav-number">2.</span> <span class="nav-text">条件式动作指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#if标签"><span class="nav-number">2.1.</span> <span class="nav-text">if标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#choose-when和otherwise"><span class="nav-number">2.2.</span> <span class="nav-text">choose,when和otherwise</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#iterator动作指令"><span class="nav-number">3.</span> <span class="nav-text">iterator动作指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#forEach标签"><span class="nav-number">3.1.</span> <span class="nav-text">forEach标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#forTokens标签"><span class="nav-number">3.2.</span> <span class="nav-text">forTokens标签</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#格式化动作指令"><span class="nav-number">4.</span> <span class="nav-text">格式化动作指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#formatNumber标签"><span class="nav-number">4.1.</span> <span class="nav-text">formatNumber标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#formatDate标签"><span class="nav-number">4.2.</span> <span class="nav-text">formatDate标签</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#函数"><span class="nav-number">5.</span> <span class="nav-text">函数</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#contains函数"><span class="nav-number">5.1.</span> <span class="nav-text">contains函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#containsIgnoreCase函数"><span class="nav-number">5.2.</span> <span class="nav-text">containsIgnoreCase函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#endsWith函数"><span class="nav-number">5.3.</span> <span class="nav-text">endsWith函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#startsWith函数"><span class="nav-number">5.4.</span> <span class="nav-text">startsWith函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#escapeXml函数"><span class="nav-number">5.5.</span> <span class="nav-text">escapeXml函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#indexOf函数"><span class="nav-number">5.6.</span> <span class="nav-text">indexOf函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#join函数"><span class="nav-number">5.7.</span> <span class="nav-text">join函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#split函数"><span class="nav-number">5.8.</span> <span class="nav-text">split函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#length函数"><span class="nav-number">5.9.</span> <span class="nav-text">length函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#replace函数"><span class="nav-number">5.10.</span> <span class="nav-text">replace函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#substring函数"><span class="nav-number">5.11.</span> <span class="nav-text">substring函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#substringBefore函数"><span class="nav-number">5.12.</span> <span class="nav-text">substringBefore函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#substringAfter函数"><span class="nav-number">5.13.</span> <span class="nav-text">substringAfter函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#toLowerCase函数"><span class="nav-number">5.14.</span> <span class="nav-text">toLowerCase函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#toUpperCase函数"><span class="nav-number">5.15.</span> <span class="nav-text">toUpperCase函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#trim函数"><span class="nav-number">5.16.</span> <span class="nav-text">trim函数</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#sql标签"><span class="nav-number">6.</span> <span class="nav-text">sql标签</span></a></li></ol></div></div></section></div></aside></div></main><footer id="footer" class="footer" onselectstart="return!1"><div class="footer-inner"><div class="copyright">&copy; 2016 - <span itemprop="copyrightYear">2019</span>&nbsp;&nbsp; <span class="author" itemprop="copyrightHolder">MrBird</span>&nbsp;&nbsp;|<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>&nbsp;&nbsp;UV&nbsp;<span class="busuanzi-value" id="busuanzi_value_site_uv" style="cursor:pointer" title="统计开始时间：2019年7月5日"></span> &nbsp;&nbsp;PV&nbsp;<span class="busuanzi-value" id="busuanzi_value_site_pv" style="cursor:pointer" title="统计开始时间：2019年7月5日"></span></div></div></footer><div class="back-to-top"><span style="font-family:'Source Sans Pro','Helvetica Neue',Arial,sans-serif;font-size:1.2em;font-weight:600">TOP</span></div></div><script type="text/javascript">"[object Function]"!==Object.prototype.toString.call(window.Promise)&&(window.Promise=null)</script><script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script><script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script><script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script><script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script><script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script><script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script><script type="text/javascript">function proceedsearch(){$("body").append('<div class="search-popup-overlay local-search-pop-overlay"></div>').css("overflow","hidden"),$(".search-popup-overlay").click(onPopupClose),$(".popup").toggle();var t=$("#local-search-input");t.attr("autocapitalize","none"),t.attr("autocorrect","off"),t.focus()}var isfetched=!1,isXml=!0,search_path="search.xml";0===search_path.length?search_path="search.xml":search_path.endsWith("json")&&(isXml=!1);var path="/"+search_path,onPopupClose=function(t){$(".popup").hide(),$("#local-search-input").val(""),$(".search-result-list").remove(),$("#no-result").remove(),$(".local-search-pop-overlay").remove(),$("body").css("overflow","")},searchFunc=function(t,e,o){"use strict";$("body").append('<div class="search-popup-overlay local-search-pop-overlay"><div id="search-loading-icon"><i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i></div></div>').css("overflow","hidden"),$("#search-loading-icon").css("margin","20% auto 0 auto").css("text-align","center"),$.ajax({url:t,dataType:isXml?"xml":"json",async:!0,success:function(t){isfetched=!0,$(".popup").detach().appendTo(".header-inner");var n=isXml?$("entry",t).map(function(){return{title:$("title",this).text(),content:$("content",this).text(),url:$("url",this).text()}}).get():t,r=document.getElementById(e),s=document.getElementById(o),a=function(){var t=r.value.trim().toLowerCase(),e=t.split(/[\s\-]+/);e.length>1&&e.push(t);var o=[];if(t.length>0&&n.forEach(function(n){function r(e,o,n,r){for(var s=r[r.length-1],a=s.position,i=s.word,l=[],h=0;a+i.length<=n&&0!=r.length;){i===t&&h++,l.push({position:a,length:i.length});var p=a+i.length;for(r.pop();0!=r.length&&(s=r[r.length-1],a=s.position,i=s.word,p>a);)r.pop()}return c+=h,{hits:l,start:o,end:n,searchTextCount:h}}function s(t,e){var o="",n=e.start;return e.hits.forEach(function(e){o+=t.substring(n,e.position);var r=e.position+e.length;o+='<b class="search-keyword">'+t.substring(e.position,r)+"</b>",n=r}),o+=t.substring(n,e.end)}var a=!1,i=0,c=0,l=n.title.trim(),h=l.toLowerCase(),p=n.content.trim().replace(/<[^>]+>/g,""),u=p.toLowerCase(),f=decodeURIComponent(n.url),d=[],g=[];if(""!=l&&(e.forEach(function(t){function e(t,e,o){var n=t.length;if(0===n)return[];var r=0,s=[],a=[];for(o||(e=e.toLowerCase(),t=t.toLowerCase());(s=e.indexOf(t,r))>-1;)a.push({position:s,word:t}),r=s+n;return a}d=d.concat(e(t,h,!1)),g=g.concat(e(t,u,!1))}),(d.length>0||g.length>0)&&(a=!0,i=d.length+g.length)),a){[d,g].forEach(function(t){t.sort(function(t,e){return e.position!==t.position?e.position-t.position:t.word.length-e.word.length})});var v=[];0!=d.length&&v.push(r(l,0,l.length,d));for(var C=[];0!=g.length;){var $=g[g.length-1],m=$.position,x=$.word,w=m-20,y=m+80;w<0&&(w=0),y<m+x.length&&(y=m+x.length),y>p.length&&(y=p.length),C.push(r(p,w,y,g))}C.sort(function(t,e){return t.searchTextCount!==e.searchTextCount?e.searchTextCount-t.searchTextCount:t.hits.length!==e.hits.length?e.hits.length-t.hits.length:t.start-e.start});var T=parseInt("1");T>=0&&(C=C.slice(0,T));var b="";b+=0!=v.length?"<li><a href='"+f+"' class='search-result-title'>"+s(l,v[0])+"</a>":"<li><a href='"+f+"' class='search-result-title'>"+l+"</a>",C.forEach(function(t){b+="<a href='"+f+'\'><p class="search-result">'+s(p,t)+"...</p></a>"}),b+="</li>",o.push({item:b,searchTextCount:c,hitCount:i,id:o.length})}}),1===e.length&&""===e[0])s.innerHTML='<div id="no-result"><i class="fa fa-search fa-5x" /></div>';else if(0===o.length)s.innerHTML='<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>';else{o.sort(function(t,e){return t.searchTextCount!==e.searchTextCount?e.searchTextCount-t.searchTextCount:t.hitCount!==e.hitCount?e.hitCount-t.hitCount:e.id-t.id});var a='<ul class="search-result-list">';o.forEach(function(t){a+=t.item}),a+="</ul>",s.innerHTML=a}};r.addEventListener("input",a),$(".local-search-pop-overlay").remove(),$("body").css("overflow",""),proceedsearch()}})};$(".popup-trigger").click(function(t){t.stopPropagation(),isfetched===!1?searchFunc(path,"local-search-input","local-search-result"):proceedsearch()}),$(".popup-btn-close").click(onPopupClose),$(".popup").click(function(t){t.stopPropagation()}),$(document).on("keyup",function(t){var e=27===t.which&&$(".search-popup").is(":visible");e&&onPopupClose()})</script></body><script>$(function(){$("a").not(".nav-link,.cloud-tie-join-count,.ignore-href,.jstree-anchor").addClass("animsition-link")});var burst1=new mojs.Burst({left:0,top:0,radius:{5:40},children:{shape:"circle",fill:["red","cyan","orange"],fillOpacity:.8,radiusX:3.5,radiusY:3.5}});document.addEventListener("click",function(a){null==a.target.href&&"footer"!=a.target.className&&"copyright"!=a.target.className&&"author__urls social-icons"!=a.target.className&&"author__avatar"!=a.target.className&&"sidebar sidebar-active"!=a.target.className&&burst1.tune({x:a.pageX,y:a.pageY}).generate().replay()})</script><script type="text/javascript" src="/js/message.js"></script></html><!-- rebuild by neat -->